import { Map } from 'immutable'

const defaultState = Map({
    banners: [],
    hotRecommends: [],
    newAlbums: [],

    upRanking: {},
    newRanking: {},
    originRanking: {},
})

function reducer(state = defaultState, action) {
    switch (action.type) {
        case "banners":
            return state.set('banners', action.banners)
        case "hotRecommends":
            return state.set('hotRecommends', action.hotRecommends)
        case "newAlbums":
            return state.set('newAlbums', action.newAlbums)
        case "upRanking":
            return state.set('upRanking', action.upRanking)
        case "newRanking":
            return state.set('newRanking', action.newRanking)
        case "originRanking":
            return state.set('originRanking', action.originRanking)
        default:
            return state
    }
}

export default reducer